// eslint-disable-next-line import/no-unresolved
import {PageHeaderWrapper} from '@ant-design/pro-layout';
import React, {Component} from 'react';
import {Row, Col, Alert, Table, Card} from 'antd';
import {connect} from 'dva';
import styles from './index.less';


class Chart extends Component {



  render() {

    const columns = [
      {
        title: '操作',
        dataIndex: '',
        key: 'x',
        render: (text, record) => (
          <span>
        <a style={{marginRight: 16}}>编辑</a>
        <a style={{marginRight: 16}}>删除</a>
      </span>
        ),
      },
      {
        title: '图表', dataIndex: 'chart', key: 'chart',
        render: (text, record) => (
          <a>{record.dashboard}</a>
        ),
      },
      {title: '可视化类型', dataIndex: 'VisualizationType', key: 'VisualizationType'},
      {title: '数据源', dataIndex: 'dataSource', key: 'dataSource'},
      {title: '创建者', dataIndex: 'creator', key: 'creator'},
      {title: '修改时间', dataIndex: 'modified', key: 'modified'},
    ];

    const data = [
      {
        chart: '疫情增长趋势',
        creator: 'lifeng',
        VisualizationType: '曲线图',
        modified: '2 Month Ago',
        dataSource: '在线疫情数据'
      }];

    return (
      <div >
        <Card>
          <Table
            columns={columns}
            dataSource={data}
          />
        </Card>

        {/* <div style={{paddingTop: 100, textAlign: 'center'}}> */}
        {/*  <Spin spinning={loading} size="large"></Spin> */}
        {/* </div> */}
        {/*{userList}*/}
      </div>)
  }

}

// 这里使用析构,拆出state中的demo
// demo对象 即models/demo.js中的state对象
export default connect(({demo}) => ({
  listInfo: demo.listInfo,
}))(Chart);
